home *** CD-ROM | disk | FTP | other *** search
- on camLogInit
- global oPuppeteer, oStoryteller, gOriginPoint, gCPU
- freezeInventory()
- disablePeekAlert()
- if getState(oStoryteller, #playerHasVideotape) = #usedUp then
- puppetSprite(45, 1)
- updateStage()
- set the castNum of sprite 45 to getProp(the lsForegroundData of oPuppeteer, #camRewind)
- set the visible of sprite 45 to 0
- set the loc of sprite 45 to point(323, 213) + gOriginPoint
- set storedPosition to getState(oStoryteller, #videoTapePosition)
- if storedPosition <> #none then
- set the movieTime of sprite 44 to storedPosition
- end if
- if gCPU = #PC then
- suspendSounds(#fadeOut)
- end if
- end if
- updateStage()
- end
-
- on camLogShutdown
- global oPuppeteer, oStoryteller, gCPU
- unFreezeInventory()
- enablePeekAlert()
- set storedPosition to getState(oStoryteller, #videoTapePosition)
- if storedPosition <> #none then
- setState(oStoryteller, #videoTapePosition, the movieTime of sprite 44)
- end if
- puppetSprite(45, 0)
- updateStage()
- if (getState(oStoryteller, #playerHasVideotape) = #usedUp) and (gCPU = #PC) then
- restoreSounds(#fadeIn)
- end if
- end
-
- on camControl whichBtn
- global oStoryteller, oPuppeteer
- set storedPosition to getState(oStoryteller, #videoTapePosition)
- set buttonStack to getProp(the lsMultiFrames of oPuppeteer, #camButtons)
- set buttonSprite to 0
- repeat with i = 10 to 48
- if getPos(buttonStack, the castNum of sprite i) then
- set buttonSprite to i
- exit repeat
- end if
- end repeat
- set markerList to [60, 2168, 4448, 7922, 12490, 15000]
- if whichBtn = #prevMarker then
- set the castNum of sprite buttonSprite to getAt(buttonStack, 3)
- end if
- if whichBtn = #play then
- set the castNum of sprite buttonSprite to getAt(buttonStack, 4)
- end if
- if whichBtn = #nextMarker then
- set the castNum of sprite buttonSprite to getAt(buttonStack, 5)
- end if
- if whichBtn = #pause then
- set the castNum of sprite buttonSprite to getAt(buttonStack, 6)
- end if
- updateStage()
- set buttonDownTime to the ticks
- repeat while the ticks < (buttonDownTime + 8)
- nothing()
- end repeat
- set the castNum of sprite buttonSprite to getAt(buttonStack, 2)
- if integerp(storedPosition) then
- set currentPosition to the movieTime of sprite 44
- set currentSegment to 1
- repeat with i = 1 to count(markerList)
- if getAt(markerList, i) <= currentPosition then
- set currentSegment to i
- end if
- end repeat
- set onScreen to the loc of sprite 44
- set offScreen to the loc of sprite 45
- if (whichBtn = #prevMarker) or (whichBtn = #nextMarker) then
- if (whichBtn = #prevMarker) and (currentSegment > 1) then
- set currentSegment to currentSegment - 1
- end if
- if (whichBtn = #nextMarker) and (currentSegment < count(markerList)) then
- set currentSegment to currentSegment + 1
- end if
- set newPosition to getAt(markerList, currentSegment)
- set trueLength to abs(the movieTime of sprite 44 - newPosition) / 20
- set maxLength to 300
- set rewindLength to min(trueLength, maxLength)
- set the movieRate of sprite 44 to 0
- set the movieTime of sprite 44 to newPosition
- set the loc of sprite 44 to offScreen
- set the movieTime of sprite 45 to 0
- updateStage()
- set the loc of sprite 45 to onScreen
- set the movieRate of sprite 45 to 1
- set the visible of sprite 45 to 1
- set the volume of sprite 45 to abs(the volume of sprite 45)
- updateStage()
- set stopTime to the ticks + rewindLength
- repeat while the ticks < stopTime
- updateStage()
- end repeat
- set the visible of sprite 45 to 0
- set the loc of sprite 45 to offScreen
- set the movieRate of sprite 45 to 0
- set the loc of sprite 44 to onScreen
- set the movieTime of sprite 44 to newPosition
- updateStage()
- set the movieRate of sprite 44 to 1
- updateStage()
- end if
- if whichBtn = #pause then
- set the movieRate of sprite 44 to 0
- end if
- if whichBtn = #play then
- if the movieTime of sprite 44 > 15000 then
- set the movieTime of sprite 44 to 15000
- else
- set the movieTime of sprite 44 to the movieTime of sprite 44
- end if
- set the movieRate of sprite 44 to 1
- end if
- else
- end if
- end
-
- on setvideoTapePosition suggestion
- global oStoryteller
- setProp(the lsStateData of oStoryteller, #videoTapePosition, [suggestion])
- end
-
- on freezeInventory
- global oStoryteller, oPuppeteer, gFreezeInventory
- set the inventoryStatus of oPuppeteer to #cool
- setState(oStoryteller, #inventoryStatus, #cool)
- set gFreezeInventory to 1
- end
-
- on unFreezeInventory
- global gFreezeInventory
- setState(oStoryteller, #inventoryStatus, #hot)
- set gFreezeInventory to 0
- end
-
- on testForPsionicWaves suggestion
- global oStoryteller, oPuppeteer
- set cameraFeedbackRemaining to count(getProp(the lsStateData of oStoryteller, #cameraFeedbackRemaining))
- set oscillatorInPlace to getState(oStoryteller, #oscillatorInPlace)
- set tonalResidueRemaining to count(getProp(the lsStateData of oStoryteller, #tonalResidueRemaining))
- if (cameraFeedbackRemaining < 1) and oscillatorInPlace and (tonalResidueRemaining < 4) then
- setState(oStoryteller, #psionicWavesPresent, 1)
- if inState(#hauntsRemaining, #phoneMessage) then
- setState(oStoryteller, #ghostlyPhoneCall, #ringingNow)
- end if
- end if
- end
-
- on setGhostlyPhoneCall suggestion
- global oStoryteller, oPuppeteer
- set currentState to getState(oStoryteller, #ghostlyPhoneCall)
- if not getPos([#notyet, #ringingNow, #speaking, #done], suggestion) then
- alert(" Sorry, " & suggestion & " is not an acceptable value for #ghostlyPhoneCall...")
- exit
- end if
- if suggestion = #ringingNow then
- if voidp(the lsEarshot of oPuppeteer) then
- set phoneVol to 0
- else
- set phoneVol to getaProp(the lsEarshot of oPuppeteer, #phoneVol)
- if not integerp(phoneVol) then
- set phoneVol to 0
- end if
- end if
- setLoop(#phoneRinging, phoneVol)
- updateStage()
- end if
- if suggestion = #speaking then
- cursorOff()
- endLoop(#phoneRinging)
- if (getState(oStoryteller, #psionicWavesPresent) = 1) and inState(#hauntsRemaining, #phoneMessage) then
- soundEffect(#phoneRoxy)
- wait(#soundStop, #phoneRoxy)
- set suggestion to #done
- setLoop(#roxyCallDone)
- trimState(#hauntsRemaining, #phoneMessage)
- trimState(#hauntsRemaining, #spookyOperator)
- setState(oStoryteller, #AMBERVISION, #waitingForPlayer)
- setState(oStoryteller, #PKamberStatus, #WaveActivated)
- setState(oStoryteller, #PeekDisplay, #amberStatus)
- else
- if inState(#hauntsRemaining, #spookyOperator) then
- if getState(oStoryteller, #phoneButtonsPressed) > 6 then
- soundEffect(#spookyOperator)
- wait(#soundStop, #spookyOperator)
- trimState(#hauntsRemaining, #spookyOperator)
- setProp(the lsStateData of oStoryteller, #phoneButtonsPressed, [0])
- setLoop(#phoneDead)
- end if
- else
- if inState(#hauntsRemaining, #phoneMessage) then
- setLoop(#phoneDead)
- else
- setLoop(#roxyCallDone)
- end if
- end if
- end if
- end if
- if suggestion = #done then
- cursorOn()
- endLoop(#phoneRinging)
- endLoop(#spookyOperator)
- endLoop(#phoneRoxy)
- testForPsionicWaves()
- end if
- setProp(the lsStateData of oStoryteller, #ghostlyPhoneCall, [suggestion])
- end
-
- on ghostCalls suggestion, howLoud
- global oStoryteller
- set possibleCallLists to [#allGhosts, #Brice_entry, #Margaret_entry, #Edwin_entry, #Brice_warm, #Margaret_warm, #Edwin_warm, #Brice_cool, #Margaret_cool, #Edwin_cool, #none]
- set valueCheck to getPos(possibleCallLists, suggestion)
- if valueCheck = 0 then
- exit
- end if
- set suggestedCalls to []
- if suggestion = #allGhosts then
- repeat with theGhost in [#Margaret, #Brice, #Edwin]
- if inState(#ghostsRemaining, theGhost) then
- append(suggestedCalls, theGhost)
- append(suggestedCalls, #nobody)
- append(suggestedCalls, #nobody)
- append(suggestedCalls, #nobody)
- end if
- end repeat
- end if
- if suggestion = #Brice_entry then
- if inState(#ghostsRemaining, #Brice) then
- set suggestedCalls to [#Brice]
- end if
- end if
- if suggestion = #Margaret_entry then
- if inState(#ghostsRemaining, #Margaret) then
- set suggestedCalls to [#Margaret]
- end if
- end if
- if suggestion = #Edwin_entry then
- if inState(#ghostsRemaining, #Edwin) then
- set suggestedCalls to [#Edwin]
- end if
- end if
- if suggestion = #Brice_warm then
- if inState(#ghostsRemaining, #Brice) then
- set suggestedCalls to [#Brice, #nobody, #nobody]
- end if
- end if
- if suggestion = #Margaret_warm then
- if inState(#ghostsRemaining, #Margaret) then
- set suggestedCalls to [#Margaret, #nobody, #nobody]
- end if
- end if
- if suggestion = #Edwin_warm then
- if inState(#ghostsRemaining, #Edwin) then
- set suggestedCalls to [#Edwin, #nobody, #nobody]
- end if
- end if
- if suggestion = #Brice_cool then
- if inState(#ghostsRemaining, #Brice) then
- set suggestedCalls to [#Brice, #nobody, #nobody, #nobody]
- end if
- end if
- if suggestion = #Margaret_cool then
- if inState(#ghostsRemaining, #Margaret) then
- set suggestedCalls to [#Margaret, #nobody, #nobody, #nobody]
- end if
- end if
- if suggestion = #Edwin_cool then
- if inState(#ghostsRemaining, #Edwin) then
- set suggestedCalls to [#Edwin, #nobody, #nobody, #nobody]
- end if
- end if
- if count(suggestedCalls) < 1 then
- set suggestedCalls to [#nobody]
- end if
- report("<i> suggestedCalls = " & suggestedCalls)
- setProp(the lsStateData of oStoryteller, #ghostsCalling, suggestedCalls)
- if suggestion = #none then
- set the volume of sound 5 to 50
- else
- set volCheck to getaProp([#low: 90, #medium: 180, #high: 255], howLoud)
- if voidp(volCheck) then
- else
- set the volume of sound 5 to volCheck
- end if
- end if
- setProp(the lsStateData of oStoryteller, #ghostCallVol, [the volume of sound 5])
- report("<i> ghostCalls(): New volume is " & the volume of sound 5)
- end
-
- on playDomainEntrySound
- global oStoryteller, oPuppeteer, gCurrentEntrySounds, gSoundPath, gEntrySoundFiles, domainIsReady, gSoundsSuspended
- if gSoundsSuspended = 1 then
- exit
- end if
- if domainIsReady = 0 then
- exit
- end if
- if not soundBusy(5) then
- set batterUp to getState(oStoryteller, #ghostsCalling)
- if (batterUp <> #nobody) or (waitAsec() = #finished) then
- set the volume of sound 5 to getState(oStoryteller, #ghostCallVol)
- if voidp(gCurrentEntrySounds) then
- set gCurrentEntrySounds to [#Margaret: 1, #Brice: 1, #Edwin: 1, #nobody: 1]
- set gEntrySoundFiles to [#Margaret: ["Mcall1.aif", "Mcall10.aif", "Mcall2.aif", "Mcall3.aif", "Mcall4.aif", "Mcall5.aif", "Mcall6.aif", "Mcall7.aif", "Mcall8.aif", "Mcall9.aif"], #Brice: ["Bcall1.aif", "Bcall10.aif", "Bcall11.aif", "Bcall2.aif", "Bcall3.aif", "Bcall4.aif", "Bcall5.aif", "Bcall6.aif", "Bcall7.aif", "Bcall8.aif", "Bcall9.aif"], #Edwin: ["Ecall1.aif", "Ecall10.aif", "Ecall11.aif", "Ecall12.aif", "Ecall2.aif", "Ecall3.aif", "Ecall4.aif", "Ecall5.aif", "Ecall6.aif", "Ecall7.aif", "Ecall8.aif", "Ecall9.aif"], #nobody: ["Nobody.aif"]]
- end if
- set soundList to getProp(gEntrySoundFiles, batterUp)
- set oldSound to getProp(gCurrentEntrySounds, batterUp)
- set newSound to (oldSound mod count(soundList)) + 1
- if batterUp = #nobody then
- waitAsec(#start)
- else
- sound playFile 5, gSoundPath & getAt(soundList, newSound)
- end if
- setProp(gCurrentEntrySounds, batterUp, newSound)
- if count(getProp(the lsStateData of oStoryteller, #ghostsCalling)) > 1 then
- set statelist to getProp(the lsStateData of oStoryteller, #ghostsCalling)
- addAt(statelist, 1, getLast(statelist))
- deleteAt(statelist, count(statelist))
- end if
- end if
- end if
- end
-
- on togglePreloading
- global gPreloading
- set gPreloading to not gPreloading
- unLoadCast()
- if gPreloading then
- else
- end if
- end
-
- on toggleTransitions qualityDesired
- global gStopTransitions, oPuppeteer, gTransQuality
- set gTransQuality to qualityDesired
- if qualityDesired = #none then
- set gStopTransitions to 1
- else
- set gStopTransitions to 0
- end if
- if qualityDesired = #Better then
- setProp(the lsMachineProfile of oPuppeteer, #transitions, [#turnRight: "02,1,16,TRUE", #turnLeft: "01,1,16,TRUE", #forward: "09,1,8,TRUE", #lookAt: "09,1,8,TRUE", #backOff: "10,1,8,TRUE", #lookUp: "03,1,16,TRUE", #lookDown: "04,1,16,TRUE", #fadeIn: "50,2,0,TRUE", #slowMontage: "50,3,0,TRUE", #nextPage: "2,2,32,TRUE", #prevPage: "1,2,32,TRUE"])
- end if
- if qualityDesired = #Best then
- setProp(the lsMachineProfile of oPuppeteer, #transitions, [#turnRight: "02,1,16,TRUE", #turnLeft: "01,1,16,TRUE", #forward: "26,2,0,TRUE", #lookAt: "26,2,0,TRUE", #backOff: "26,2,0,TRUE", #lookUp: "03,1,16,TRUE", #lookDown: "04,1,16,TRUE", #fadeIn: "26,2,0,TRUE", #slowMontage: "26,3,0,TRUE", #nextPage: "2,2,16,TRUE", #prevPage: "1,2,16,TRUE"])
- end if
- end
-
- on toggleBitDepth
- global g16bit
- if g16bit then
- set the colorDepth to 8
- if the colorDepth = 8 then
- set g16bit to 0
- else
- alert("Couldn't set the colordepth to 8-bit.. (Check the Monitors control panel for this monitor)")
- end if
- else
- set the colorDepth to 16
- if the colorDepth = 16 then
- set g16bit to 1
- else
- alert("Couldn't set the colordepth to 16-bit.. (Check the Monitors control panel for this monitor)")
- end if
- end if
- if g16bit then
- else
- end if
- end
-
- on selectiveUpdate castlist
- global oPuppeteer, oStoryteller
- set castUpdates to []
- set spotUpdates to []
- set match to #none
- repeat with teststring in castlist
- repeat with candidate in the lsOnStage of oPuppeteer
- if getProp(candidate, #castName) = teststring then
- set match to candidate
- put RETURN & "match = " & match
- exit repeat
- end if
- end repeat
- if match <> #none then
- append(lsUpdates, match)
- set match to #none
- next repeat
- end if
- repeat with candidate in the lsAllHotspots of oPuppeteer
- if getAt(getAt(candidate, 3), 1) = teststring then
- set match to candidate
- put RETURN & "match = " & match
- exit repeat
- end if
- end repeat
- if match = #none then
- alert("No match for string: '" & teststring & "'")
- next repeat
- end if
- append(lsUpdates, match)
- set match to #none
- end repeat
- put RETURN & ">> FINAL LIST <<"
- put castUpdates
- end
-
- on changePal startCast, finishCast, newPalette
- set newPaletteNumber to the number of cast newPalette
- repeat with i = startCast to finishCast
- if the castType of cast i = #bitmap then
- set the palette of cast i to newPaletteNumber
- next repeat
- end if
- put the name of cast i & " is not a #bitmap castmember."
- end repeat
- end
-